<?php 

include ("../../inc/application_settings.php");
include(APPLICATION_COMMON);



/**
 * creates the menue for finacial status
 * @param string item financial status
 * @param string item graphic
 * @return string output
 */
function CreateMenue($financestate, $graphic){
	$output = '';
	
	$output .= '<div id="leftMenue" >';
	$output .= '<ul  id="menueList">';
	$output .= '<li class="itemSelected" destination="' . FINANCESTATE .'" params="T=STATUS">'.$financestate.'</li>';
	$output .= '<li destination="' . FINANCESTATE .'" params="T=GRAPHIC">'.$graphic.'</li>';
	$output .= '</ul>';
	$output .= '</div>';
	$output .= '<div id="content" >' . CreateStatusLayout() .'</div>';
	
	return $output;
}


/**
 * creates layout for status menue item
 * @return string layout
 */
function CreateStatusLayout(){
	return 'hier ist der finanzstatus - :P';
}



/**
 * creates the layout for graphic menue item
 * @return string layout
 */
function CreateGraphicLayout(){
	return 'graphic layout';
}




/**
 * creates the default layout 
 */
function CreateDefaultLayout(){
	try{
		$mysql = new MYSQL(DB_NAME,DB_USER,DB_PASSWORD,DB_SERVER);
		$mysql->Connect();
		$financestate = GetLanguageSpecificText($mysql,"financestate_menue",LANGUAGE);
		$graphic = GetLanguageSpecificText($mysql,"graphics_menue",LANGUAGE);
		$mysql->Disconnect();
	
		return CreateMenue($financestate, $graphic);
	} catch (Exception $e){
		echo $e->getMessage();
	}
}






$menue = (isset($_REQUEST['T']))?$_REQUEST['T']:NULL;

switch($menue){
	case 'STATUS':
		echo CreateStatusLayout();
		break;
	case 'GRAPHIC':
		echo CreateGraphicLayout();
		break;
	default:
		echo CreateDefaultLayout();
		break;
}
?>



